package com.whcoding.designpatterns.pattern.prototype.register;

import com.whcoding.designpatterns.pattern.prototype.SheepVO;

/**
 * @program: spring-boot-learning
 * @description:
 * @author: whcoding
 * @create: 2022-09-21 16:25
 **/
public class RegisterPrototypeTests {

	private static PrototypeManager mgr = new PrototypeManager();

	private static CloneSheep2Impl sheep;

	private static void registerSheep() {
		sheep = new CloneSheep2Impl("多莉", 1, "white");
		SheepVO sheep1 = sheep.clone();
		mgr.add(sheep);
	}

	public static void main(String[] args) {
		for (int i = 0; i < 5; i++) {
			RegisterPrototypeTests.registerSheep();
		}
		for (int i = 0; i < RegisterPrototypeTests.mgr.getSize(); i++) {
			System.out.println(RegisterPrototypeTests.mgr.get(i));
		}
	}

}
